/**
 * 
 */
package vn.com.fsoft.utility;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.hibernate.Session;

/**
 * @author VangND1
 * 
 */
public class HibernateUtils {
	private static SessionFactory sessionFactory;

	public SessionFactory getSessionFactory() {
		sessionFactory = new Configuration().configure().buildSessionFactory();
		return sessionFactory;
	}

	public void closeSession(Session session) {
		if (session.isOpen()) {
			session.close();
		}
	}
}
